/*
   FieldVis - A Tool for Visualizing Astrophysical Magnetohydrodynamic Flow
   
   Copyright (C) 2006 - 2008     FieldVis Development Team
  
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
  
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
  
   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

   File     : Texture.h
   Author   : Blayne Field
   
   Purpose  : Definition header file for the Texture class.  This class
              holds all of the relevant information for creating a texture.
*/

#ifndef TEXTURE_H
#define TEXTURE_H

#include <stdio.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <string>

const int MAX_CHARS(256);


class Texture
{
public:

   Texture(std::string pFileName);
   
   ~Texture()     { }   // nothing to do here!!

   // accessors
   GLuint GetID() const             { return texID; }
   float GetMinValue() const        { return textureMin; }
   float GetMaxValue() const        { return textureMax; }
   float GetMinSize() const         { return minSize; }
   float GetMaxSize() const         { return maxSize; }
   float GetMinMaxFactor() const    { return minMaxFactor; }
   float GetTextureLength() const   { return textureLength; }
   
   void SetMinMaxFactor(float factor)  { minMaxFactor = factor; }
   void SetTextureLength(float len)    { textureLength = len; }
   void SetSize(float min, float max)  { minSize = min; maxSize = max; }
   void SetRange(float min, float max) { textureMin = min; textureMax = max; }

private:
   
   GLubyte *texImage;
   std::string fileName;
   int texLength;
   int texWidth;
   int texHeight;

   float minSize;
   float maxSize;
   float textureLength;

   float minMaxFactor;

   float textureMin;
   float textureMax;

   GLuint texID;

   bool ReadTexture();
};

#endif

